<template>
	<view class="pages">
		<u-navbar title="草稿列表" :autoBack="true" placeholder bgColor="#fff"></u-navbar>
		<view class="draft-page">
			<view style="width: 100%; height: 1px;background-color: #6d7873;"></view>
			<view class="order-list" v-for="(item, index) in orderList" :key="index" @click="toPage(item, index)">
				<view class="box-name">
					<view class="left">{{item.userInfo.name}}</view>
					<view class="right">销售订单</view>
				</view>
				<view class="box-name">
					<view class="">{{item.creatDate}}</view>
					<view class="" style="color: red;">{{item.totalPrice}}</view>
				</view>
			</view>
			<view class="" style="height: 100rpx;" v-if="isFullSucreen"></view>
		</view>
	</view>
</template>

<script>
	export default {
	  data() {
	    return {
				isFullSucreen: this.isFullSucreen,
				orderList: [],
				orgInfo: {},
	    }
	  },
		onLoad() {
			this.orgInfo = uni.getStorageSync('orgInfo')
		},
	  onShow() {
			this.orderList = []
			let arr = uni.getStorageSync('draftList')
			arr.forEach(item => {
				if(item.orgId == this.orgInfo.orgId) {
					this.orderList.push(item)
				}
			})
	  },
	  methods: {
	    toPage(item, index) {
	    	uni.navigateTo({
	    	  url: '/other/salesOrder/orderDetail?dateIndex=' + index
	    	})
	    }
	  }
	}
</script>

<style lang="scss" scoped>
	.pages{
		width: 750rpx;
		min-height: 100vh;
		background-color: #fff;
		.draft-page {
			width: 100%;
			.order-list {
				width: 100%;
				padding: 20rpx 30rpx;
				border-bottom: 1px solid #6d7873;
				.box-name {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-bottom: 20rpx;
					color: #464444;
					.left {
						font-size: 36rpx;
						color: #000;
					}
				}
			}
		}
	}
</style>